package zemberek3.crosscheck;

import org.jcaki.SimpleTextReader;
import org.jcaki.SimpleTextWriter;
import zemberek3.lexicon.RootLexicon;
import zemberek3.lexicon.SuffixProvider;
import zemberek3.lexicon.tr.TurkishDictionaryLoader;
import zemberek3.lexicon.tr.TurkishSuffixes;

import java.io.File;
import java.io.IOException;
import java.text.Collator;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

public class MasterDictionaryOps {
    static void checkLemmasFromTdk() throws IOException {
        SuffixProvider sp = new TurkishSuffixes();
        RootLexicon items = TurkishDictionaryLoader.loadDefaultDictionaries(sp);
    }

    static void sortDictionary(File dicFile) throws IOException {
        List<String> all = SimpleTextReader.trimmingUTF8Reader(dicFile).asStringList();
        Collections.sort(all, Collator.getInstance(new Locale("tr")));
        SimpleTextWriter.oneShotUTF8Writer(dicFile).writeLines(all);
    }

}
